package cool.webstudy.admin.constant.enums;

import lombok.Getter;

/**
 * 
 * @author 莫振双
 * @date 2024/7/14 21:40
 * @description: 身份枚举类
 */
@Getter
public enum RoleEnum {
    SYSTEM("system"),
    ADMIN("admin"),
    USER("user");
    private String role;
    RoleEnum(String role) {
        this.role = role;
    }
    public static RoleEnum getRole(String role) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.getRole().equals(role)) {
                return roleEnum;
            }
        }
        return RoleEnum.USER;
    }

}
